
import axios from "axios"


const instance =axios.create({
    baseURL:"",
    timeout:5000

})



instance.interceptors.request.use(function (config) {

    return config;
  }, function (error) {

    return Promise.reject(error);
  });

  

  instance.interceptors.response.use(function (response) {

    return response;
  }, function (error) {

    return Promise.reject(error);
  });


const request = (payload) =>{
 
    return instance.request({
        ...payload
    }).then(res=>res.data).catch(err=>err)
}

export { request,instance,}